
# @target:  hello
# @input: files main.o a.o
# @cmd: gcc -o target_name（目标文件，或者PHONY） input_files（依赖目标）
# 执行顺序是  main.o -> a.o -> hello 
# 变量 
#定义变量 make 自动归纳所有.o 文件 
# 2.6 Another Style of Makefile
# When the objects of a makefile are created only by implicit rules, 
# an alternative style of makefile is possible. In this style of makefile,
# you group entries by their prerequisites instead of by their targets.
# Here is what one looks like:
C_SRC = main.c a.c

C_OBJ = main.o a.o

C_INC = a.h main.h

TARGET = hello

$(TARGET): $(C_OBJ) 
	gcc -o hello $(C_OBJ) 

$(C_OBJ) :  $(C_INC)
	gcc -c main.c  
	gcc -c a.c
	
.PHONY:clean
clean : 
	rm $(TARGET).exe $(C_OBJ)